// app.js
import './utils/http.js'
import './utils/toast.js'
import './utils/util.js'
App({
  onLaunch() {
    // 展示本地存储能力
   this.gettoken()
   this.getUserInfo()
  },
  globalData: {
    userInfo: null
  },
  gettoken () {
    this.token = wx.getStorageSync('token')
  },
  async getUserInfo () {
    const res = await wx.http.get('/user/getUserInfo')
    console.log(res);
    this.globalData.userInfo = res.data.userInfo
  },
  settoken(key,value){
  wx.setStorageSync(key, value)
  this[key]=value
  }
})
